odoo.define("web_optimize.HierarchyRegister", function (require) {
"use strict";

class HierarchyRegister {
    constructor(mapping) {
        this.map = Object.create(mapping || null);
    }
    add(key, value) {
        this.map[key] = value;
        return this;
    }

    contains(key) {
        return key in this.map;
    }
    entries() {
        const entries = {};
        const keys = this.keys();
        for (const key of keys) {
            entries[key] = this.map[key];
        }
        return entries;
    }

    get(key) {
        return this.map[key];
    }

    values() {
        return this.keys().map((key) => this.map[key]);
    }
}

return HierarchyRegister;

});


odoo.define("web_optimize.hierarchy_register", function (require) {
"use strict";

var HierarchyRegister = require('web_optimize.HierarchyRegister');

return new HierarchyRegister();
});

